//Component Object
const app = getApp();
const { apiInstance } = app

Component({
  properties: {
    data: {
      type: Object,
      value: {},
      observer: function (e) {
        if (e) {

          this.setData({
            form: e,
          })
        }
      }
    },
    isEdit: {
      type: Boolean,
      value: false,
      observer: function (e) {
        if (e) {
          this.setData({
            isEdit: e,
          })
        }
      }
    },
  },

  data: {
    form: {},
    comfirmPassCurrent:'',
    contentTypeCurrent:[],
    needReCallCurrent:'',
    environmentImpactCurrent:'',
    residentImpactCurrent:'',
    resultCurrent:'',
    refuseTypeCurrent:[],
    needCleanCurrent:'',
    hasSeletedPersonResponsibleCurrent:'',
    hasEmergencyPlanCurrent:'',
    isFollowOrderCurrent:'',
  isOrNotList: [{
    id: 1,
    name: '是'
  }, {
    id: 2,
    name: '否'
  }],
  
  },
  
 
  methods: {
    handleNeedCleanCurrentChange({detail}){
      this.setData({
        needCleanCurrent: detail.value,
         'form.needClean': detail.value,
       });
    },

    handleHasSeletedPersonResponsibleCurrentChange({detail}){
      this.setData({
        hasSeletedPersonResponsibleCurrent: detail.value,
         'form.hasSeletedPersonResponsible': detail.value,
       });
    },

    handleHasEmergencyPlanChange({detail}){
      this.setData({
        hasEmergencyPlanCurrent: detail.value,
         'form.hasEmergencyPlan': detail.value,
       });
    },

    handleIsFollowOrderCurrentChange({detail}){
      this.setData({
        isFollowOrderCurrent: detail.value,
         'form.isFollowOrder': detail.value,
       });
    },

    bindValue(e){

      this.setData({
        [e.target.dataset.itemname]:e.detail.detail.value,
      });


    },
    
   
    
  },
  lifetimes: {
    created: async function () {

    },
    attached: function () {

    },
    ready: async function () {


    },
    moved: function () {

    },
    detached: function () {

    }
  }

});